''微信公众号关注：VB小源码
''QQ群：344402874
''博客：https://www.cnblogs.com/vbee/
''个人微信：vbee_club


Imports System.Security.Cryptography
Imports System.Text

Public Class Form1
  Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
    '公钥
    Dim s As String = "PFJTQUtleVZhbHVlPjxNb2R1bHVzPjdpSG91UlluMCtDc0NvaHhVamt3MmllVlRRek1TWjFNR2RqUlFvdVZwc2VQeWVnWVQvUHEyOWh2Nm9TNG5CVjRrcGsybG10dnJ4VlI2TUJ0NHhvM1BGTnR6d05JY1RtYmthNElHaUd2MjVCSDE3NHJITS92dDVZd1lrVTNIRjRBWmFiMzFFOTUzQWUzRUpESm1uYXo5UzRGNnF4NHE1bFE0SFAxbDY1SC9CVT08L01vZHVsdXM+PEV4cG9uZW50PkFRQUI8L0V4cG9uZW50PjwvUlNBS2V5VmFsdWU+"
    Dim en_cont As String = String.Empty
    Using rsa As New RSACryptoServiceProvider()
      rsa.FromXmlString(Encoding.Default.GetString(Convert.FromBase64String(s)))
      Dim en_data As Byte() = rsa.Encrypt(Encoding.Default.GetBytes(TextBox1.Text), False)
      en_cont = Convert.ToBase64String(en_data)
    End Using
    RichTextBox1.Text = en_cont
  End Sub
End Class
